package com.sky.service.user.impl;

import com.sky.mapper.admin.MerchantMapper;
import com.sky.pojo.Merchant;
import com.sky.result.Result;
import com.sky.service.user.MerchantService;
import com.sky.vo.ShopVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MerchantServiceImpl implements MerchantService {

    @Autowired
    private MerchantMapper merchantMapper;
    @Override
    public Result getMerchantInfo() {

        Merchant merchant = merchantMapper.selectById(1l);
        String shopName = merchant.getShopName();
        String shopAddress = merchant.getShopAddress();
        String shopTelephone = merchant.getShopTelephone();
        ShopVO shopVO = ShopVO.builder().shopName(shopName).shopAddress(shopAddress).phone(shopTelephone).build();
        return Result.success(shopVO);
    }
}
